package cn.wolfcode.qo;

import cn.wolfcode.util.CustomerReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class CustomerReportQueryObject extends QueryObject {
    private Long businessId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private Integer typeId;
    private String groupBy = CustomerReportEnum.NAME.name();

    public String getGroupBySql(){
        return CustomerReportEnum.valueOf(this.groupBy).getSql();
    }


}
